package com.bawei.library_common.mvvm

import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModelProvider

/**
 * @Author : yaotianxue
 * @Time : On 2023/5/29 19:08
 * @Description : BaseMvvmFragment
 */
abstract class BaseMvvmFragment<VM:BaseViewModel,VDB: ViewDataBinding>:BaseFragment<VDB>() {
    protected val viewModel:VM by lazy { ViewModelProvider(activity as AppCompatActivity).get(getJVMClass()) }
    //子类重写 返回具体的viewmodel对应class文件
    abstract fun getJVMClass():Class<VM>
}